package com.example.rpcproviderdemo.jacksondemo.service.impl;

import com.example.rpcproviderdemo.jacksondemo.service.IShopRpc;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
@DubboService(version = "1.0.0",group = "shop")
public class ShopRpcImpl implements IShopRpc {

    private static Long countInvk =1L;

    @Value("${dubbo.application.name}")
    private String serviceName;

    @Override
    public String sayHello(String name) {
        System.err.println("rpc调用成功了!");
        return String.format("hhh ,%s : Hello, %s", serviceName, name);
    }

    @Override
    public String ping() {
        countInvk++;
        System.err.println(countInvk);
        return "pong";
    }

    @Override
    public String test3(Integer aaa) {
        return "success: "+aaa.toString();
    }
}
